package wj;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

import javax.jws.soap.SOAPBinding;

public class Appwj {
        public static void main(String[] args) throws Exception{
            User u = new User();
            u.setName("Timor");
            System.out.println(u.getName());
            Class<?> UU =Class.forName("wj.User");
            Object o = UU.newInstance();
            Method setName = UU.getMethod("setName", String.class);
            setName.invoke(o,"Jenkins");
            Method getName = UU.getMethod("getName");
            Object result = getName.invoke(o);
            System.out.println(result);
            Method setAge = UU.getMethod("setAge", String.class);
            setAge.invoke(o,"18");
            Method getAge = UU.getMethod("getAge");
            Object result1 = getAge.invoke(o);
            System.out.println(result1);
            u.setAge("18");
            System.out.println(u.getAge());
        }
    }






